package com.apes.fn.scm.vipSettle.service;

import com.apes.framework.query.ApesDao;
import org.hibernate.loader.plan.spi.Return;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class VipUnionSettleFormula extends ApesDao {

    public List<Map> findPaymentMethodByTime(){
        String sql="SELECT  DISTINCT a.* FROM retail_order a,retail_payment_method_item b " +
                "where b.retail_order_id = a.id and a.company_id <> b.company_id  " +
                "and trunc(a.date_done) > = to_date('2022-8-1','yyyy-mm-dd') and trunc(a.date_done) < =to_date('2022-8-2','yyyy-mm-dd')";
        return this.find(sql);
    }

    public List<Map> findDiscountByTime(){
        String sql="SELECT  DISTINCT a.* FROM retail_order a,retail_order_discount_item b " +
                "where b.retail_order_id = a.id and a.company_id <> b.company_id " +
                "and trunc(a.date_done) > = to_date('2022-8-1','yyyy-mm-dd') and trunc(a.date_done) < =to_date('2022-8-2','yyyy-mm-dd')";
        return this.find(sql);
    }
}
